<template>
	<view class="content">
		<view class="title">{{data.title}}</view>
		<view class="create_time">{{data.create_time}}</view>
		<view class="rich">
			<rich-text :nodes="data.content"></rich-text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: '',
			}
		},
		onLoad(e) {
			this.API_noticeDetail(e.id);
		},
		onShareTimeline() {
			return {
				title: '西岭小雪净水',
				query: {
					key: ''
				},
				imageUrl: ''
			}
		},
		onShareAppMessage() {
			wx.showShareMenu({
				withShareTicket: true,
				menus: ['shareAppMessage', 'shareTimeline']
			})
		},
		methods: {
			API_noticeDetail(id) {
				var that = this;
				that.ran
					.request('index/Index/noticeDetail', {
						id: id,
					})
					.then(res => {
						if (res.code == 0) {
							that.data = res.data;
						} else {
							uni.showToast({
								title: res.msg,
								icon: 'none',
							})
						}
					});
			},
		}
	}
</script>

<style lang="scss">
	.content {
		padding: 20rpx;

		.title {
			font-size: 30rpx;
			line-height: 1.5;
		}

		.create_time {
			font-size: 24rpx;
			color: #666;
			line-height: 100rpx;
			border-bottom: 1px solid #d6d7dc;
		}

		.rich {
			margin-top: 20rpx;
		}
	}
</style>